#define _CRT_SECURE_NO_WARNINGS
#include<stdio.h>
int main()
{
    while (1)
    {
        int n = 0, m = 0, c;
        scanf("%d%d", &n, &m);
        if (m == 0, n == 0)
            break;
        else
        {
            for (int i = 0; i < n; i++)
            {
                scanf("%d", &arr[i]);
            }
            for (int i = 0; i < n; i++)
            {
                if (arr[i] < m)
                {
                    c = i;
                    break;
                }

            }
            for (int j = n - 1; j >= c; j--)
            {
                arr[j + 1] = arr[j];
            }
            arr[c] = m;
            for (int i = 0; i <= n; i++)
            {
                printf("%d \n", arr[i]);
            }
        }
    }
    return 0;
}